package com.fenfen.novel.rest;

import com.fenfen.novel.model.Category;
import com.fenfen.novel.model.Chapter;
import com.fenfen.novel.model.Novel;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;

public interface NovelService {

  @GET("novel/top/{type}")
  Call<List<Novel>> showNovelsByTop(@Path("type") byte topType);

  @GET("novel/top/{type}/{page}")
  Call<List<Novel>> showNovelsByTopAndPage(@Path("type") byte topType, @Path("page") int page);

  @GET("novel/top/{type}/{page}/{size}")
  Call<List<Novel>> showNovelsByTopAndPageSize(@Path("type") byte topType, @Path("page") int page, @Path("size") int size);

  @GET("novel/search/{key}/{page}")
  Call<List<Novel>> searchNovelsByPage(@Path("key") String searchVal, @Path("page") int page);

  @GET("novel/{novel_id}")
  Call<Novel> showNovel(@Path("novel_id") int novelId);

  @GET("novel/{novel_id}/chapters/list/all")
  Call<List<Chapter>> showNovelChaptersAll(@Path("novel_id") int novelId);

  @GET("novel/{novel_id}/chapters/list/{page}")
  Call<List<Chapter>> showNovelChaptersByPage(@Path("novel_id") int novelId, @Path("page") int page);

  @GET("novel/{novel_id}/chapters/list/{page}/{size}")
  Call<List<Chapter>> showNovelChaptersByPageSize(@Path("novel_id") int novelId, @Path("page") int page, @Path("size") int size);

  @GET("novel/{novel_id}/chapters/{chapter_id}")
  Call<List<Chapter>> showNovelChapter(@Path("novel_id") int novelId, @Path("chapter_id") int chapter_id);

  @GET("novel/{novel_id}/chapters/order/{chapter_order}")
  Call<List<Chapter>> showNovelChapterByOrder(@Path("novel_id") int novelId, @Path("chapter_order") int chapter_order);

  @GET("novel/categorys/all")
  Call<List<Category>> showAllCateogrys();

  @GET("novel/categorys/{category_id}/{page}")
  Call<List<Novel>> showNovelsByCategoryIdAndPage(@Path("category_id") int categoryId, @Path("page") int page);

  @GET("novel/categorys/{category_id}/{page}/{size}")
  Call<List<Novel>> showNovelsByCategoryIdAndPageSize(@Path("category_id") int category_id, @Path("page") int page, @Path("size") int size);

  @GET("novel/{novel_id}/download")
  Call<String> showNovelDownloadStatus(@Path("novel_id") int novelId);
}
